package com.thread;

import org.junit.Test;

/**
 * @author Conceit
 * @version 1.0, 2017/1/3
 */

public class TestThreadRun extends Thread {
    private int count = 1;
    private String name;


    public TestThreadRun(String name) {
        this.name = name;
    }

    public void run() {

        for (int i = 0; i < 5; i++) {
            System.out.println(name + "name" + "   " + "count" + count++);
            //线程中间随机相差时间
            try {
                sleep((int) Math.random() * 10);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

        }
    }
}
